<%@ page contentType="text/html;charset=UTF-8"%>
<%@ include file="/WEB-INF/views/include/taglib.jsp"%>
<html>
<head>
<title>站点管理</title>
<meta name="decorator" content="default" />
<script type="text/javascript">
	$(document).ready(function() {

	});
	function page(n, s) {
		$("#pageNo").val(n);
		$("#pageSize").val(s);
		$("#searchForm").submit();
		return false;
	}
</script>
</head>
<body>
	<ul class="nav nav-tabs">
		<li class="active"><a href="${ctx}/site/tSitedtl/">站点列表</a></li>
		<shiro:hasPermission name="site:tSitedtl:edit">
			<li><a href="${ctx}/site/tSitedtl/form">站点添加</a></li>
		</shiro:hasPermission>
	</ul>
	<form:form id="searchForm" modelAttribute="siteQry"
		action="${ctx}/site/tSitedtl/" method="post"
		class="breadcrumb form-search">
		<input id="pageNo" name="pageNo" type="hidden" value="${page.pageNo}" />
		<input id="pageSize" name="pageSize" type="hidden"
			value="${page.pageSize}" />
		<ul class="ul-form">
			<li><label class="control-label">站点类型：</label>
				<form:select path="spottype" class="input-small">
					<option value="">请选择</option>
					<form:options items="${fns:getDictList('spottype')}"
						itemLabel="label" itemValue="value" htmlEscape="false" />
				</form:select>
			</li>
			<li><label class="control-label">归属区域：</label>
				<sys:treeselect id="area" name="area.id" value="${siteQry.area.id}"
					labelName="area.name" labelValue="${siteQry.area.name}" title="区域" 
					url="/sys/area/treeData"  notAllowSelectParent="true" allowClear="true" cssClass="input-small" />
			</li>
			<li><label>站点名称：</label> <form:input path="sitename"
					maxlength="50" class="input-small" /></li>
			<li><label class="control-label">热点城市：</label>
				<form:select path="ishot" class="input-small">
					<form:option value="" label="" />
					<form:options items="${fns:getDictList('yes_no')}"
						itemLabel="label" itemValue="value" htmlEscape="false" />
				</form:select>
			</li>
			<li class="btns"><input id="btnSubmit" class="btn btn-primary"
				type="submit" value="查询" /></li>
			<li class="clearfix"></li>
		</ul>
	</form:form>
	<sys:message content="${message}" />
	<table id="contentTable"
		class="table table-striped table-bordered table-condensed">
		<thead>
			<tr>
				<th>城市</th>
				<th>地点名称</th>
				<th>是否热门</th>
				<shiro:hasPermission name="site:tSitedtl:edit">
					<th>操作</th>
				</shiro:hasPermission>
			</tr>
		</thead>
		<tbody>
			<c:forEach items="${page.list}" var="tSitedtl">
				<tr>
					<%-- <td>${fns:getDictLabel(tSitedtl.citycode, 'T_city', '无')}</td> --%>
					<td>${tSitedtl.cityname}</td>
					<td>${tSitedtl.sitename}</td>
					<td>${fns:getDictLabel(tSitedtl.ishot, 'yes_no', '否')}</td>
					<shiro:hasPermission name="site:tSitedtl:edit">
						<td>
							<a href="${ctx}/site/tSitedtl/form?id=${tSitedtl.siteid}">修改</a>
							<c:choose>
							<c:when test="${tSitedtl.ishot == 0}">
								<a href="${ctx}/site/tSitedtl/setHot?id=${tSitedtl.siteid}&ishot=1&qryname=${siteQry.sitename}&qrycityid=${siteQry.area.id}&qrycityname=${siteQry.area.name}"
								onclick="return confirmx('确认要设置该站点为热点吗？', encodeURI(this.href))">设为热点</a>
							</c:when>
							<c:when test="${tSitedtl.ishot == 1}">
								<a href="${ctx}/site/tSitedtl/setHot?id=${tSitedtl.siteid}&ishot=0&qryname=${siteQry.sitename}&qrycityid=${siteQry.area.id}&qrycityname=${siteQry.area.name}"
								onclick="return confirmx('确认要取消热点吗？', encodeURI(this.href))">取消热点</a>
							</c:when>
							</c:choose>
							<a href="${ctx}/site/tSitedtl/delete?id=${tSitedtl.siteid}"
							onclick="return confirmx('确认要删除该站点吗？', this.href)">删除</a>
						</td>
					</shiro:hasPermission>
				</tr>
			</c:forEach>
		</tbody>
	</table>
	<div class="pagination">${page}</div>
</body>
</html>